package net.wendal.base.util;

import java.util.LinkedHashSet;
import java.util.Set;

/**
 * Created by y on 2017/2/8.
 */
public class CollectionDataTest {

    public static void main(String[] args) {
        Set<String> set = new LinkedHashSet<String>(new CollectionData<String>(new Government(), 3));

        set.addAll(CollectionData.list(new Government(), 3));

        System.out.println(set);

    }
}

class Government implements Generator<String> {

    String[] foundation = ("strange women for").split(" ");

    private int index;

    @Override
    public String next() {
        return foundation[index++];
    }
}
